﻿CREATE TABLE [dbo].[Message](
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[FromID] [bigint] NOT NULL CONSTRAINT [DF_Letter_FromId]  DEFAULT ((0)),
	[ToID] [bigint] NOT NULL CONSTRAINT [DF_Letter_ToId]  DEFAULT ((0)),
	[Title] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Body] [nvarchar](4000) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[SendTime] [smalldatetime] NOT NULL CONSTRAINT [DF_Letter_SendTime]  DEFAULT (getdate()),
	[IsSee] [bit] NOT NULL CONSTRAINT [DF_Letter_IsSee]  DEFAULT ((0)),
	[IsFromDel] [bit] NOT NULL CONSTRAINT [DF_Message_IsFromDel]  DEFAULT ((0)),
	[IsToDel] [bit] NOT NULL CONSTRAINT [DF_Message_IsToDel]  DEFAULT ((0)),
	[IsHtml] [bit] NOT NULL CONSTRAINT [DF_Message_IsHtml]  DEFAULT ((0)),
 CONSTRAINT [PK_Message_1] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_Message] UNIQUE NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]